" Maintainer: Dr. Charles E. Campbell, Jr. <cec@gryphon.gsfc.nasa.gov>
" Last change: March 29, 1998
" Remove any old syntax stuff hanging around
syn clear
" Read the C syntax to start with
so <sfile>:p:h/c.vim
" --- Lex stuff ---
"I'd prefer to use lex.* , but it doesn't handle forward definitions yet
let b:lexlist="lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatString,lexPatTag,lexPatTag,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,lexPatCode,cInParen"
let b:lexlistpc="lexAbbrvBlock,lexAbbrv,lexAbbrv,lexAbbrvRegExp,lexInclude,lexPatBlock,lexPat,lexBrace,lexPatTag,lexPatTag,lexPatComment,lexPatCodeLine,lexMorePat,lexPatSep,lexSlashQuote,cInParen"
" Abbreviations Section
syn region lexAbbrvBlock start="^\([a-zA-Z_]\+\t\|%{\)" end="^%%$"me=e-2 skipnl nextgroup=lexPatBlock contains=lexAbbrv,lexInclude
syn match lexAbbrv "^\I\i*\s"me=e-1 skipwhite contained nextgroup=lexAbbrvRegExp
syn match lexAbbrv "^%[sx]" contained
syn match lexAbbrvRegExp "\s\S.*$"lc=1 contained nextgroup=lexAbbrv,lexInclude
syn keyword ClexFunctions BEGIN input unput woutput yyleng yylook yytext
syn keyword ClexFunctions ECHO output winput wunput yyless yymore yywrap
" <c.vim> includes several ALLBUTs; these have to be treated so as to exclude lex* groups
syn clear cParen cDefine cPreProc cMulti
syn region cParen start='(' end=')' transparent contains=ALLBUT,cParenError,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel,lex.*
syn region cDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,cPreCondit,cIncluded,cInclude,cDefine,cInParen,lex.*
syn region cPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,cPreCondit,cIncluded,cInclude,cDefine,cInParen,lex.*
syn region cMulti start='?' end=':' transparent contains=ALLBUT,cIncluded,cSpecial,cTodo,cUserCont,cUserLabel,lex.*
" Synchronization
syn sync clear
syn sync minlines=300
syn sync match lexSyncPat grouphere lexPatBlock "^%[a-zA-Z]"
syn sync match lexSyncPat groupthere lexPatBlock "^<$"
syn sync match lexSyncPat groupthere lexPatBlock "^%%$"